package chapter02;

import java.util.Scanner;

public class Training09 {

    public static void main(String[] args) {
        Scanner scl=new Scanner(System.in);
        System.out.println("请输入班级人数");
        int rs=scl.nextInt();
        double [] score=new double[rs];
        int gt80=0;
        int gt70=0;
        int gt60=0;
        int lt60=0;
        double sum=0;


        for (int i = 0; i < score.length; i++) {
            System. out. println ("请输入"+(i+1)+"位学生的成绩：") ;
            score[i]=scl. nextInt();
            sum=sum+score[i];
            if (score[i] >80) {
                gt80++;
            }else if (score[i]>70) {
                gt70++;
            }else if (score[i] >60) {
                gt60++;
            }else if (score[i] <60) {
                lt60++;
            }else{
                System.out.println("格式错误");
            }

        }
        sum=sum/rs;
        System. out. println("学生的平均成绩是："+sum);
        System.out.println("大于80分："+gt80);
        System.out.println("大于70分："+gt70);
        System.out.println("大于60分："+gt60);
        System.out.println("不及格："+lt60);
    }
}
